<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- saved from url=(0014)about:internet -->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<title>ActionScript 3 YouTube Wrapper</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="author" content="The Chopping Block, Inc." />
	<meta name="geo.country" content="US" />
	<meta name="dc.language" content="en" />
	<meta name="keywords" content="YouTube, ActionScript 3.0, JavaScript, Wrapper, Flash, choppingblock, The Chopping Block, Demo" />
	<meta name="description" content="The ActionScript 3.0 Wrapper for YouTube Chromeless Player leverages ActionScript's ExternalInterface class and YouTube's JavaScript API to create a reliable approach to integrating the YouTube API into your ActionScript 3.0 projects." />
	<style type="text/css" media="screen">
		@import url("_assets/css/global.css");
		@import url("_assets/css/home.css");
	</style>
	<style type="text/css" media="print">
		@import url("_assets/css/print.css");
	</style>
	<style type="text/css" media="screen">
		
		body {
			background-color: #eeeeee;
			font: .8em/1.3em verdana,arial,helvetica,sans-serif;
		}
	
		#flashcontent {
/*			border: solid 1px #000;*/
			width: 960px;
			height: 500px;
			margin: 15px 20px;
		}
		
		#info {
			overflow: auto;
			margin: 0px 20px;
		}
		
		#download {
			overflow: auto;
			margin: 15px 20px;
		}
	
	</style>
	<script type="text/javascript" src="_assets/js/swfobject.js"></script>
	<script type="text/javascript" src="_assets/js/youTubeLoader.js"></script>
	<script type="text/javascript">
	
		var flashvars = {};
		var params = {
			menu: "false",
			allowScriptAccess: "always",
			scale: "noscale"
		};
		var attributes = {};
	
		swfobject.embedSWF("YouTubeIntegrationDemo.swf", "flashcontent", "960", "500", "9.0.0", "_assets/swf/expressInstall.swf", flashvars, params, attributes);
		
		//init the youTubeLoader javascript methods
		SWFID = "flashcontent"
			
	</script>
	<script type="text/javascript">
		// Demo Javascript
		// Big thanks to Google, Lisa Larson-Kelley @ flashconnections.com and the FlashCodersNY.org list for establishing the javascript demo foundation.
		
		function updateHTML(elmId, value) {
          document.getElementById(elmId).innerHTML = value;
        }

        function setytplayerState(newState) {
          updateHTML("playerstate", newState);
        }

		// PLEASE NOTE: For the purpose of this demo:
		// This method is called from the onYouTubePlayerReady method inside _assets/js/youTubeLoader.js
        function secondaryOnYouTubePlayerReady(playerId) {
          ytplayer = document.getElementById(SWFID);
          setInterval(updateytplayerInfo, 250);
          updateytplayerInfo();
          ytplayer.addEventListener("onStateChange", "onytplayerStateChange");
        }

		// PLEASE NOTE: For the purpose of this demo:
		// This method is called from the onytplayerStateChange method inside _assets/js/youTubeLoader.js
        function secondaryOnytplayerStateChange(newState) {
          setytplayerState(newState);
        }

        function updateytplayerInfo() {
          updateHTML("bytesloaded", getBytesLoaded());
          updateHTML("bytestotal", getBytesTotal());
          updateHTML("videoduration", getDuration());
          updateHTML("videotime", getCurrentTime());
          updateHTML("startbytes", getStartBytes());
          updateHTML("volume", getVolume());
        }
		
		function alertEmbed () {
			alert( getEmbedCode() );
		}
		
		function alertVideoUrl () {
			alert( getVideoUrl() );
		}
		
		function unloadVideo () {
			stop();
			clearVideo();
		}
			
	</script>
</head>
<body>

	<div id="flashcontent">
		<h1>Alternative content</h1>
		<p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>
	</div>

	<div id="info">
		<div>
	      Player state: <span id="playerstate">--</span>
	    </div>
	    <br />
	      <a href="javascript:void(0);" onclick="play();">Play</a> | <a href="javascript:void(0);" onclick="pause();">Pause</a> | <a href="javascript:void(0);" onclick="stop();">Stop</a> | <a href="javascript:void(0);" onclick="mute();">Mute</a> | <a href="javascript:void(0);" onclick="unMute();">Unmute</a>
	    <br /><br />
	    <form action="" onsubmit="seekTo(document.getElementById('seekto').value); return false;">
	      <div><input id="seekto" type="text" size="4" /><input type="submit" value="Seek to" /></div>
	    </form>
	    <br />
	    <div>
	      Duration: <span id="videoduration">--:--</span> | Current Time: <span id="videotime">--:--</span>
	    </div>
	    <br />
	    <div id="bytesdisplay">
	      Bytes Total: <span id="bytestotal">--</span> | Start Bytes: <span id="startbytes">--</span> | Bytes Loaded: <span id="bytesloaded">--</span>
	    </div>
	    <br />
	    <div>
	      <input type="text" size="11" id="loadvideoid" value="u1zgFlCw8Aw" />
	      <a href="javascript:void(0)" onclick="loadVideoById(document.getElementById('loadvideoid').value, document.getElementById('startseconds').value)">&lt;-
	        Load video</a> | Start at: <input type="text" size="4" id="startseconds" value="0" />
	    </div>
	    <br />
	    <div>
	      <input id="vol" type="text" size="3" /> 
	      <a href="javascript:void(0)" onclick="setVolume(document.getElementById('vol').value)" />&lt;- Set Volume</a>  | Volume: <span id="volume">--</span>
	    </div>
	    <br />
	    <div>
	      <input tyep="text" size="11" id="cuevideoid" value="u1zgFlCw8Aw" />
	      <a href="javascript:void(0)" onclick="cueNewVideo(document.getElementById('cuevideoid').value, document.getElementById('startseconds2').value)">&lt;- Cue video</a> | Start at: <input type="text" size="4" id="startseconds2" value="0" />
	    </div>
	    <br />
	    <div>
	        <a href="javascript:void(0)" onclick="alertEmbed()">Get Embed Code</a> | <a href="javascript:void(0)" onclick="alertVideoUrl()">Get Video URL</a> | <a href="javascript:void(0);" onclick="unloadVideo()">Clear Video</a>  
	    </div>
	  </div>
	</div> 

	<div id="download">
		<a href="http://code.google.com/p/youtubechromelesswrapper-as3/downloads/list">Click here</a> to download source files.<br /><br />
		<!-- Creative Commons License -->
		<a href="http://creativecommons.org/licenses/LGPL/2.1/">
		<img alt="CC-GNU LGPL" border="0" src="http://creativecommons.org/images/public/cc-LGPL-a.png" />
		</a><br />
		This software is licensed under the <a href="http://creativecommons.org/licenses/LGPL/2.1/">CC-GNU LGPL</a> version 2.1 or later.
		<!-- /Creative Commons License -->
	
	</div>
	<script type="text/javascript">
	var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
	document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
	</script>
	<script type="text/javascript">
	var pageTracker = _gat._getTracker("UA-308995-1");
	pageTracker._trackPageview();
	</script>
</body>
</html>
